package com.chen.mysqltopostgres.constant;

import java.util.HashMap;
import java.util.Map;

/**
 * @author: cgd
 * @description:
 * @date: 2022/8/23 10:04
 * @version: 1.0
 */
public class ColDataTypeMap {
    public static Map<String, String> dataTypeMap;

    static {
        dataTypeMap = new HashMap<>();
        dataTypeMap.put("enum", "LOWER(CONCAT(c.COLUMN_NAME, '_t'))");
        dataTypeMap.put("tinyint", "smallint");
        dataTypeMap.put("mediumint", "integer");
        dataTypeMap.put("tinyint unsigned", "smallint");
        dataTypeMap.put("smallint unsigned", "integer");
        dataTypeMap.put("mediumint unsigned", "integer");
        dataTypeMap.put("int unsigned", "bigint");
        dataTypeMap.put("bigint unsigned", "numeric(20)");
        dataTypeMap.put("double", "double precision");
        dataTypeMap.put("float", "real");
        dataTypeMap.put("datetime", "timestamp");
        dataTypeMap.put("longtext", "text");
        dataTypeMap.put("mediumtext", "text");
        dataTypeMap.put("blob", "bytea");
        dataTypeMap.put("mediumblob", "bytea");
    }
}
